<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    body{
        text-align: center;
    }
    table{
        width: 100%;
    }
</style>
<body>
 <script>
    let total=+prompt('请输入你的银行卡余额')
    let waterprice=+prompt('请输入水费')
    let eletricityprice=+prompt('请输入电费')
    let interentprice=+prompt('请输入网费')
    let totalcardprice=total-waterprice-eletricityprice-interentprice
    document.write(`
    <table border="1" cellspacing="0" cellpading="0">
        <caption>
            <h1>2020年12月消费支出</h1>
        </caption>
        <tr>
            <th>银行卡余额</th>
            <th>水费</th>
            <th>电费</th>
            <th>网费</th>
            <th>银行卡余额</th>
        </tr>
        <tr>
            <td>${total}</td>
            <td>${waterprice}</td>
            <td>${eletricityprice}</td>
            <td>${interentprice}</td>
            <td>${totalcardprice}</td>
        </tr>
    </table>
`)
  </script>
</body>
</html>